Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

NURB Curves

Figure 14 shows a NURB curve.

Figure 14 A NURB curve

Labels

ASCII
NURBCurve
Binary
nrbc ( = 0x6E726263 )

Data Format

Uns32                               order
Uns32                               nPoints
RationalPoint4D                     points[nPoints]
Float32                             knots[order + nPoints]
order
The order of the NURB curve. For NURB curves defined by ratios of cubic B-spline polynomials, the order is 4. In general, the order of a NURB curve defined by polynomial equations of degree n is n +1. The value of this field must be greater than 1.
nPoints
The number of control points that define the NURB curve. The value of this field must be greater than 1.
points[]
An array of rational four-dimensional control points that define the NURB curve. The w coordinate of each control point must be greater than 0.
knots[]
An array of knots that define the NURB curve. The number of knots in a NURB curve is the sum of the values in the order and nPoints fields. The values in this array must be nondecreasing. Successive values may be equal, up to a multiplicity equivalent to the order of the curve; that is, if the order of a NURB curve is n, then at most n successive values may be equal.

Data Size

8 + (nPoints * 16) + ((nPoints + order) * 4)

Description

A nonuniform rational B-spline (NURB) curve is a three-dimensional projection of a four-dimensional curve. A NURB curve is specified by its order, the number of control points used to define it, the control points themselves, and the knots used to define it. Attributes may be applied only to the entire NURB curve.

Default Surface Parameterization

None.

Parent Hierarchy

Shared, shape, geometry.

Parent Objects

None.

Child Objects

Attribute set (optional).

Example

NURBCurve (
    4                                               # order
    7                                               # nPoints
    0 0 0 1                                         # points
    1 1 0 1
    2 0 0 1
    3 1 0 1
    4 0 0 1
    5 1 0 1
    6 0 0 1
    0 0 0 0 0.25 0.5 0.75 1 1 1 1                   # knots
)

Default Size

None.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |